package javacode.org.ssh.common.base.action;

import javacode.org.ssh.common.base.util.PaginationSupport;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.Preparable;

public class BaseAction extends ActionSupport implements Preparable {

	private static final long serialVersionUID = 5777001206790991507L;
	
	protected Log log = LogFactory.getLog(this.getClass());
	
	private PaginationSupport page ;

	@Override
	public void prepare() throws Exception {
		
	}
	
	protected HttpServletRequest getRequest() {
		return ServletActionContext.getRequest();
	}
	
	protected HttpServletResponse getResponse() {
		return ServletActionContext.getResponse();
	}
	
	protected HttpSession getSession() {
		return this.getRequest().getSession();
	}

	public PaginationSupport getPage() {
		return page;
	}

	public void setPage(PaginationSupport page) {
		this.page = page;
	}

}
